When an image is captured in order to generate a panoramic image by using an electronic device, the panoramic image is generated in such a manner that images are acquired by operating a shutter switch multiple times while moving the electronic device and then the acquired images are post-processed. Also, the electronic device having a panoramic function uses a method for setting a panorama mode and continuously capturing images while moving the camera in a state of pressing a shutter switch. Further, a method for generating a three-dimensional (3D) image is such that one camera is used to image-capture an object in different directions multiple times and then a 3D image is generated by synthesizing the captured images.